SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS   99)
SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 999)

# test to ignore for memcheck
SET (CTEST_CUSTOM_MEMCHECK_IGNORE
  "ProcessObjectDeathTest.DeleteCommandActiveProcess"
  )

SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
 ${CTEST_CUSTOM_COVERAGE_EXCLUDE}

 # Exclude try_compile sources from coverage results:
 "/CMakeFiles/CMakeTmp/"

 # Exclude files from the Testing directories
 ".*/Testing/.*"
 )

SET(CTEST_CUSTOM_WARNING_EXCEPTION
  ${CTEST_CUSTOM_WARNING_EXCEPTION}

  # Ignore warning for files with no symbols
  "warning LNK4221.*not define any previously undefined public symbols"
  "warning LNK4221.*no public symbols found"
  ".*ranlib:.*file:.*has no symbols"
  "libtool:.*file:.*has no symbols"

  # Ignore warning building SWIG
  "Swig-prefix/src/Swig"
  "parser.y.*warning"

  # Ignore warning building PCRE
  "PCRE-prefix/src/PCRE"

  # Ignore apple warning
  "ld.*warning.*duplicate dylib.*"

  # Ignore warning from the SWIG wrapped file ( not much we can do about those )
  ".*_wrap.cxx"

  # Ignore warning in lua about the use of `tmpnam' is dangerous
  "loslib"

  # RH5 GCC 4.1 is producing warnings internally for functional headers
  "mu_iterate.h.*warning? unused parameter '__tuple'"

  # Ignore CSharp invalid version warning for dev
  "warning CS1607.*The version number.*dev.*is invalid"
  "warning CS1607.*The version.*dev.*is not in the normal"
  "warning CS7035.*The specified version string.*does not conform"

  # Warning when building R, issue related to make file
  "warning: jobserver unavailable:"

  # Warning when compiling ITK v4.5.1 with clang
  "clang: warning: argument unused during.*-fno-ipa-cp-clone"

  # Warning when compiling SWIG
  "clang: warning: argument unused.*-ansi"

  # Warning from RHEL5 GCC 4.1 about visibility change
  "warning: lowering visibility of .* to match its type"

  # Warning from SWIG with self member type
  "sitkCommand.* [wW]arning 314.*self.*is a python keyword"

  # Warning from RH5 gcc 4.1.2
  "tr1/mu_iterate.h.* warning: unused parameter '__tuple'"

  # Warning on CircleCI
  "Warning: Permanently added.*to the list of known hosts"
)

SET(CTEST_CUSTOM_ERROR_EXCEPTION
  ${CTEST_CUSTOM_ERROR_EXCEPTION}

 # Error to ignore on Windows during wheel production
 "pep425tags.*RuntimeWarning.*ABI tag may be incorrect"
)
